package com.jzo2o.customer.controller.agency;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.BankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author wanfeng
 * @version 1.0
 * @since 2025-09-17 22:31
 */
@RestController("workerAgencyBankAccountController")
@RequestMapping("/agency/bank-account")
@Api(tags = "机构端 - 银行账号接口")
public class AgencyBankAccountController {
    @Resource
    private BankAccountService bankAccountService;

    /**
     * 银行账号开通或更改
     *
     * @param bankAccountUpsertReqDTO
     */
    @PostMapping
    @ApiOperation("银行账号开通或更改接口")
    public void bankAccountUpsert(@RequestBody BankAccountUpsertReqDTO bankAccountUpsertReqDTO) {
        bankAccountService.bankAccountUpsert(bankAccountUpsertReqDTO);
    }

    /**
     * 获取银行账户信息
     *
     * @return
     */
    @GetMapping("/currentUserBankAccount")
    @ApiOperation("获取银行账户信息")
    public BankAccountResDTO getAccount() {
        return bankAccountService.getAccount();
    }
}
